<?php
	class sotietkiembs
	{
		// Các trường
		public $MaSoTietKiem = ""; // auto_increment
		public $MaKH = "";
		public $MaLoaiKyHan = 0;
		public $MaHTLanhLai = 0;
		public $LaiSuatGui = 0;
		public $SoTienGui = 0;
		public $NgayMoSo = "";
		public $NgayDenHan = "";
		public $NgayLanhLai = "";
		public $LaiDaTra = 0;
		public $NgayNhapGoc = "";
		public $LaiNhapGoc = 0;
		public $NgayTatToan = "";
		public $Khoa = 0;
		public $SoDuKyHanTT = 0;
		public $SoTienNhan = 0;
		// Các phương thức
		public function Them()
		{
			$db = new sotietkiemdb();
			return $db->Them(
							 $this->MaSoTietKiem, 
						     $this->MaKH,
							 $this->MaLoaiKyHan,
						     $this->MaHTLanhLai,
						     $this->LaiSuatGui,
						     $this->SoTienGui,
						     $this->NgayMoSo, 
							 $this->NgayDenHan,
							 $this->NgayLanhLai,
							 $this->LaiDaTra,
							 $this->NgayNhapGoc,
							 $this->LaiNhapGoc,
							 $this->NgayTatToan,
							 $this->Khoa,	
							 $this->SoDuKyHanTT,
							 $this->SoTienNhan);
		}
		public function ThemSoTietKiem()
		{
			$db = new sotietkiemdb();
			return $db->ThemSoTietKiem(
					$this->MaSoTietKiem,
					$this->MaKH,
					$this->MaLoaiKyHan,
					$this->MaHTLanhLai,
					$this->LaiSuatGui,
					$this->SoTienGui,
					$this->NgayMoSo,
					$this->NgayDenHan,
					$this->NgayLanhLai,
					$this->SoDuKyHanTT,
					$this->SoTienNhan);
		}
		public function CapNhat()
		{
			$db = new sotietkiemdb();
			return $db->CapNhat($this->MaSoTietKiem, 
						     	$this->MaKH,
							 	$this->MaLoaiKyHan,
						     	$this->MaHTLanhLai,
						     	$this->LaiSuatGui,
						     	$this->SoTienGui,
						     	$this->NgayMoSo, 
								$this->NgayDenHan,
							 	$this->NgayLanhLai,
							 	$this->LaiDaTra,
							 	$this->NgayNhapGoc,
							 	$this->LaiNhapGoc,
							 	$this->NgayTatToan,
							 	$this->Khoa,	
							 	$this->SoDuKyHanTT,
								$this->SoTienNhan);
		}
		
		public function CapNhatKhoa()
		{
			$db = new sotietkiemdb();
			return $db->CapNhatKhoa($this->MaSoTietKiem,
									$this->Khoa); 
		}
		
		public function LayDanhSach()
		{
			$db = new sotietkiemdb();
			return $db->LayDanhSach($this->MaSoTietKiem, 
						     		$this->MaKH,
							 		$this->MaLoaiKyHan,
						     		$this->MaHTLanhLai,
						     		$this->LaiSuatGui,
						     		$this->SoTienGui,
						     		$this->NgayMoSo, 
									$this->NgayDenHan,
							 		$this->NgayLanhLai,
							 		$this->LaiDaTra,
							 		$this->NgayNhapGoc,
							 		$this->LaiNhapGoc,
							 		$this->NgayTatToan,
							 		$this->Khoa,	
							 		$this->SoDuKyHanTT,
									$this->SoTienNhan);
		}
		
		public function LayDanhSachKhongKyHan()
		{
			$db = new sotietkiemdb();
			return $db->LayDanhSachKhongKyHan();
		}
		
		public function LayDanhSachCoKyHan()
		{
			$db = new sotietkiemdb();
			return $db->LayDanhSachCoKyHan();
		}
	}
?>